package com.chinaoly.baotou.common;
/**
 * 响应码枚举，参考HTTP状态码的语义
 */
public enum ResultCode {
    /**成功**/
    SUCCESS(200),
    /**失败**/
    FAIL(400),
    /**系统级别错误**/
    ERROR(10997),
    /**无含义**/
    NOTHING(0),

    /*
     * 登录返回信息
     * */
    E_411(411, "请求处理异常，请稍后再试"),
    E_10008(10008, "尚无用户属于此角色"),
    E_10009(10009, "账户已存在"),
    E_10010(10010, "用户名错误"),
    E_10011(10011, "该账户被禁用"),
    E_10012(10012, "密码错误"),
    E_10013(10013, "未查询到该用户"),


    E_20011(20011, "登陆已过期,请重新登陆"),
    E_20012(20012, "验证码已失效，请刷新"),
    E_20013(20013, "验证码错误，请重新输入"),
    E_20014(20014, "token已失效"),
    E_20015(20015, "未获取到Authorization"),
    E_20016(20016, "token解析报错"),
    E_20017(20017, "登录输错已超过最大限制次数"),
    E_20018(20018, "redis获取不到用户，请检查redis配置"),
    E_20019(20019, "获取当前用户中的单位编码为空"),
    E_20020(20020, "当前用户没有菜单权限"),

    E_90003(90003, "缺少必填参数"),
    E_90004(90004, "操作失败"),

    /*
     * 公安部规范错误信息
     * */
    //通用错误
    G_10000(10000,"成功"),
    G_10001(10001,"失败"),
    G_10002(10002,"异常"),
    G_10003(10003,"出现异常，操作中断"),
    G_10004(10004,"IP不允许"),
    G_10005(10005,"请求码不存在"),
    G_10006(10006,"频繁访问异常，暂时无法访问"),
    G_99999(99999,"其他"),
    //用户错误
    G_U_1000(1000,"用户方面的错误"),
    G_U_1001(1001,"无效输入"),
    G_U_1999(1999,"其他用户方面的错误"),
    G_U_2000(2000,"应用系统方面的错误"),
    G_U_3000(3000,"安全检查类方面的错误"),
    G_U_3001(3001,"IP受限"),
    G_U_3002(3002,"时间受限"),
    G_U_3003(3003,"操作次数受限"),
    G_U_3004(3004,"用户名与密码不匹配"),
    G_U_3005(3005,"数字证书被注销"),
    G_U_3006(3006,"用户账号被冻结"),
    G_U_3007(3007,"无操作权限"),
    G_U_3999(3999,"其他安全检查方面的错误"),
    //接口错误
    G_J_1000(1000,"客户端方面的错误"),
    G_J_1001(1001,"参数错误"),
    G_J_1999(1999,"其他客户端方面的错误"),
    G_J_2000(2000,"服务端方面的错误"),
    G_J_3000(3000,"安全检查方面的错误"),
    G_J_3001(3001,"IP受限"),
    G_J_3002(3002,"时间受限"),
    G_J_3003(3003,"调用次数受限"),
    G_J_3007(3007,"无调用权限"),
    G_J_3999(3999,"其他安全检查方面的错误");



    private int errorCode;

    private String errorMsg;

    public int code;

    ResultCode(int code) {
        this.code = code;
    }
    ResultCode(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.code = errorCode;
        this.errorMsg = errorMsg;
    }
    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
        this.code = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
